package cn.mazexal.examapi.common.models;

import cn.mazexal.examapi.models.vo.ExamQuestionMaterialsVO;
import lombok.Data;

import java.util.List;

/**
 * @author: Mazexal
 * Date: 2025/5/25
 */
@Data
public class PagedQuestionData<T> extends PagedData<T>{

    private List<ExamQuestionMaterialsVO> materialsList;

    public static <T> PagedQuestionData<T> of(PagedQry qry, int total, List<T> list, List<ExamQuestionMaterialsVO> materialsList) {
        PagedQuestionData pagedQuestionData = new PagedQuestionData();
        pagedQuestionData.setData(list);
        pagedQuestionData.setTotal(total);
        pagedQuestionData.setPageSize(qry.getCurrent());
        pagedQuestionData.setCurrent(qry.getPageSize());
        pagedQuestionData.setMaterialsList(materialsList);
        return pagedQuestionData;
    }
}
